package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-06-27
 * Time: 19:22
 */
public class TestDemo {


    public static void main(String[] args) {
        BinarySearchTree binarySearchTree = new BinarySearchTree();
         int[] array = {5,4,3,1,7,8,2,6,0,9};
         for(int i =0;i<array.length;++i){
             binarySearchTree.insert(array[i]);
         }
         binarySearchTree.remove(7);
         try{
             System.out.println(binarySearchTree.search(9).val);
         }catch (NullPointerException e){
             System.out.println("没有找到");
             e.printStackTrace();
         }
        System.out.println();
    }

}
